<!doctype html>
<html class="no-js">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="description" content="">
  <meta name="keywords" content="">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>糖半甜收银系统</title>
  <!-- Set render engine for 360 browser -->
  <meta name="renderer" content="webkit">
  <!-- No Baidu Siteapp-->
  <meta http-equiv="Cache-Control" content="no-siteapp"/>

  <link rel="icon" type="image/png" href="i/favicon.png">

  <!-- Add to homescreen for Chrome on Android -->
  <meta name="mobile-web-app-capable" content="yes">
  <link rel="icon" sizes="192x192" href="i/app-icon72x72@2x.png">

  <!-- Add to homescreen for Safari on iOS -->
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="apple-mobile-web-app-title" content="Amaze UI"/>
  <link rel="apple-touch-icon-precomposed" href="i/app-icon72x72@2x.png">

  <!-- Tile icon for Win8 (144x144 + tile color) -->
  <meta name="msapplication-TileImage" content="i/app-icon72x72@2x.png">
  <meta name="msapplication-TileColor" content="#0e90d2">
  <link rel="stylesheet" href="__TMPL__/public/shop/css/amazeui.css">
  <link rel="stylesheet" href="__TMPL__/public/shop/css/app.css">
  <style type="text/css">
  	.am-dropdown-content{min-width: 20rem;}
  </style>
</head>
<body>
	<!--左侧导航栏-->
	<div class="nav-slider">
		<div id="floderbtn" class="am-bg-black am-text-center am-padding-top-sm am-padding-bottom-sm">
			<em class="am-icon-th am-text-xl am-text-white"></em>
		</div>
		<ul class="am-bg-black am-margin-0 am-padding-left-0 am-padding-top-sm am-open">
			<li class="am-active">
				<a href="{:url('menu/right')}" target="mian_frame">
					<div class="am-icon-home am-text-xl am-padding-bottom-xs"></div>
					<div>收银</div>
				</a>
			</li>
			<!-- <li>
				<a href="{:url('Store/index')}" target="mian_frame">
					<div class="am-icon-list am-text-xl am-padding-bottom-xs"></div>
					<div>店铺信息</div>
				</a>
			</li> -->			
			<!-- <li>
				<a href="{:url('Often/index')}" target="mian_frame">
					<div class="am-icon-area-chart am-text-xl am-padding-bottom-xs"></div>
					<div>营业额时时统计</div>
				</a>
			</li> -->	
			<li>
				<a href="{:url('Stream/index')}" target="mian_frame">
					<div class="am-icon-area-chart am-text-xl am-padding-bottom-xs"></div>
					<div>收银流水</div>
				</a>
			</li>
			<li>
				<a href="{:url('Single/index')}" target="mian_frame">
					<div class="am-icon-envira am-text-xl am-padding-bottom-xs"></div>
					<div>商品汇总</div>
				</a>
			</li>		
			<li>
				<a target="mian_frame" href="{:url('Member/memberList')}">
					<div class="am-icon-user am-text-xl am-padding-bottom-xs"></div>
					<div onclick="">会员列表</div>
				</a>
			</li>
			<li>
				<a href="{:url('Jiaojie/supplylist')}" target="mian_frame">
					<div class="am-icon-mixcloud am-text-xl am-padding-bottom-xs"></div>
					<div>对冲流水</div>
				</a>
			</li>				
			<li>
				<a href="{:url('Print/plist')}" target="mian_frame">
					<div class="am-icon-heart am-text-xl am-padding-bottom-xs"></div>
					<div>打印配置</div>
				</a>
			</li>
			<li>
				<a href="javascript:void(0);" id="oDownLoad" onclick="oDownLoad('url','oDownLoad')">
					<div class="am-icon-heart am-text-xl am-padding-bottom-xs"></div>
					<div>更新包下载</div>
				</a>
			</li>
		</ul>
	</div>
	<!--右侧导航栏-->
	<div class="right-area">
		<header class="am-bg-white am-padding-sm">
			<div class="am-inline-block  am-margin-right-xl"><img src="__TMPL__/public/shop/img/logo.png"></div>
			<div class="am-inline-block am-margin-left-xl">
				<div class="am-dropdown" data-am-dropdown>
				  	<div class="am-btn am-dropdown-toggle">{$session['store_name']} <span class="am-icon-caret-down am-padding-left"></span></div>
			  		<div class="am-dropdown-content">
				    	<h2 class="am-text-center am-padding-bottom-sm" style="border-bottom: 1px dashed #ccc;">{$session['store_name']}</h2>
				    	<div class="">
				    		<div class="am-padding-bottom-sm">
				    			<p class="am-margin-0 am-padding-bottom-xs">商户号：{$session['user_login']}</p>
				    			<p class="am-margin-0 am-padding-bottom-xs">账号：管理员</p>
				    			<p class="am-margin-0 am-padding-bottom-xs">登录时间：{$session['last_login_time']|date='Y-m-d  H:m:s',###}</p>
				    		</div>
				    		<div class="am-padding-left am-padding-right">
				    			<div class="remain-time">正在工作</div>
				    		</div>
				    		<ul class="am-list am-margin-bottom-0 am-avg-md-3 am-avg-lg-3 am-text-center am-padding-top am-padding-bottom">
								<li id="jiaojie">
									<a href="#">
				    					<img src="__TMPL__/public/shop/img/icon_item4.png" width="50%" />
				    					<p class="am-margin-0">交接</p>
									</a>
				    			</li>
								<li id="tongbu">
									<a href="{:url('api/Tongbu/sendpost')}">
										<img src="__TMPL__/public/shop/img/icon_item4.png" width="50%" />
										<p class="am-margin-0">同步</p>
									</a>
								</li>
				    			<!-- <li>
				    				<img src="__TMPL__/public/shop/img/icon_item4.png" width="32%" />
				    				<p class="am-margin-0">修改密码</p>
				    			</li>
				    			<li>
				    				<img src="__TMPL__/public/shop/img/icon_item4.png" width="32%" />
				    				<p class="am-margin-0">绑定账号</p>
				    			</li> -->
				    		</ul>
				    		<a href="{:cmf_url('user/Login/logout')}"><input type="button" class="am-btn am-btn-block am-radius am-btn-quit" value="退出" /></a>
				    	</div>
				  	</div>
				</div>
			</div>
		</header>
		<section class="am-content">
			<iframe id="mian_frame" name="mian_frame" src="{:url('menu/right')}" scrolling="no"></iframe>
		</section>
	</div>
<!--[if (gte IE 9)|!(IE)]><!-->
<script src="__TMPL__/public/shop/js/jquery.min.js"></script>
<!--<![endif]-->
<!--[if lte IE 8 ]>
<script src="http://libs.baidu.com/jquery/1.11.3/jquery.min.js"></script>
<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<script src="__TMPL__/public/shop/js/amazeui.ie8polyfill.min.js"></script>
<![endif]-->
<script src="__TMPL__/public/shop/js/amazeui.min.js"></script>
<script src="__TMPL__/public/shop/js/app.js"></script>
<script src="__TMPL__/public/shop/js/jquery.js"></script>
<script src="__STATIC__/js/layer/layer.js"></script>
</body>
</html>
<script>
    $('#jiaojie').click(function () {
        $.ajax({url:'/api/Tongbu/sendpost',success:function(msg){
            if(msg.code == 1){
                layer.msg('同步成功',{
						offset:['50%'],
						time: 3000 //3秒关闭
					},function(){
                    	location.href="{:url('/home/Jiaojie/index')}";
					});
			}else{
                layer.msg('注意：同步失败，请手动同步!',{
                    offset:['50%'],
                    time: 3000 //3秒关闭
                },function(){
                    location.href="{:url('/home/Jiaojie/index')}";
                });

			}
		}})

	})
</script>
<script>  
    function myBrowser(){  
        var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串  
        var isOpera = userAgent.indexOf("Opera") > -1;  
        if (isOpera) {  
            return "Opera"  
        }; //判断是否Opera浏览器  
        if (userAgent.indexOf("Firefox") > -1) {  
            return "FF";  
        } //判断是否Firefox浏览器  
        if (userAgent.indexOf("Chrome") > -1){  
            return "Chrome";  
        }  
        if (userAgent.indexOf("Safari") > -1) {  
            return "Safari";  
        } //判断是否Safari浏览器  
        if (userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1 && !isOpera) {  
            return "IE";  
        }; //判断是否IE浏览器  
        if (userAgent.indexOf("Trident") > -1) {  
            return "Edge";  
        } //判断是否Edge浏览器  
    }
    function oDownLoad(url,id) {
        $.ajax({
            async:false,
            type:"POST",
            url:"/home/Print/gengXin",
            success:function(date){
                url = date.msg;
            }
        });
        if(url.status==1){
            if (myBrowser()==="IE" || myBrowser()==="Edge"){
                var oPop = window.open(url.url,"","width=1, height=1, top=5000, left=5000");
                for(; oPop.document.readyState != "complete"; )
                {
                    if (oPop.document.readyState == "complete")break;
                }
                oPop.document.execCommand("SaveAs");
                oPop.close();
            }else{
                //!IE
                var odownLoad=document.getElementById(id);
                odownLoad.href=url.url;
                odownLoad.download="";
            }
        }else{
            layer.msg('已经是最新版本!',{time:3000});
        }
    }


</script>

